feat: add a method to compute the DB size of the state#9
Merged
talos-bot merged 1 commit intocosi-project:mainfrom Feb 11, 2026
Merged
feat: add a method to compute the DB size of the state#9talos-bot merged 1 commit intocosi-project:mainfrom
talos-bot merged 1 commit intocosi-project:mainfrom
Conversation
utkuozdemir
approved these changes
Feb 6, 2026
There was a problem hiding this comment.
Pull request overview
Adds a SQLite-state API to compute the approximate storage footprint of the state’s underlying tables, along with tests to validate the behavior as data is inserted (referenced from omni issue #2140).
Changes:
- Introduces
(*sqlite.State).DBSize(ctx)to compute table size in bytes using SQLitedbstat. - Adds tests asserting non-zero size for an empty DB and growth after inserting resources.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/state/impl/sqlite/size.go | Adds DBSize implementation querying dbstat for resources/events table page usage. |
| pkg/state/impl/sqlite/size_test.go | Adds tests covering empty DB and growth behavior after inserts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Part of siderolabs/omni#2140 Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
oguzkilcan
approved these changes
Feb 11, 2026
Member
|
/m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of siderolabs/omni#2140